package com.dwd.basic.config;

import com.dwd.user.intercepter.LoginInfoIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/18 18:44
 * @Version 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInfoIntercepter loginInfoIntercepter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInfoIntercepter)
                .addPathPatterns("/**")
                //登陆
                .excludePathPatterns("/login")
                //注册..
                .excludePathPatterns("/user/**")
                //商家入驻
                .excludePathPatterns("/shop/settlement")
                //上传
                .excludePathPatterns("/fastdfs/**")
                //发送短信
                .excludePathPatterns("/verification/**")
                //微信二维码登陆
                .excludePathPatterns("/wechat/**")
                //验证码登陆
                .excludePathPatterns("/loginVer")
                //找回密码
                .excludePathPatterns("/forget")
                //密码之存储
                .excludePathPatterns("/found")
                //校验密码
                .excludePathPatterns("/checkPassword")
                //校验重复密码/check/active
                .excludePathPatterns("/checkConfirmpassword")
                //放行激活
//                .excludePathPatterns("/check/**")
                //邮箱验证码
                .excludePathPatterns("/forgetEmail")
                //产品
//                .excludePathPatterns("/product/**")
                //支付
                .excludePathPatterns("/pay/**")
                .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**")
                ;


    }
}
